package com.istock.monitor.agent.transformer;

import java.util.HashSet;
import java.util.Set;

public class ClassRewriterRegistry {

	private Set<ClassRewriter> rewriterSet = new HashSet<ClassRewriter>();
	
	public ClassRewriterRegistry(){
		rewriterSet.add(new AbstractApplicationContextClassWriter());
//		rewriterSet.add(new AspectJCreatorClassWriter());
	}
	
	public ClassRewriter findRewriter(String className){
		for(ClassRewriter rewriter : rewriterSet){
			if(rewriter.canRewriter(className)){
				return rewriter;
			}
		}
		return null;
	}
}
